//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package org.ryzom.nel.misc;

public class CBGRA {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CBGRA(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CBGRA obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CBGRA(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CBGRA() {
    this(nelmiscJNI.new_CBGRA__SWIG_0(), true);
  }

  public CBGRA(CRGBA c) {
    this(nelmiscJNI.new_CBGRA__SWIG_1(CRGBA.getCPtr(c), c), true);
  }

  public CBGRA(short r, short g, short b, short a) {
    this(nelmiscJNI.new_CBGRA__SWIG_2(r, g, b, a), true);
  }

  public CBGRA(short r, short g, short b) {
    this(nelmiscJNI.new_CBGRA__SWIG_3(r, g, b), true);
  }

  public long getPacked() {
    return nelmiscJNI.CBGRA_getPacked(swigCPtr, this);
  }

  public boolean lt(CBGRA c) {
    return nelmiscJNI.CBGRA_lt(swigCPtr, this, CBGRA.getCPtr(c), c);
  }

  public boolean isEqual(CBGRA c) {
    return nelmiscJNI.CBGRA_isEqual(swigCPtr, this, CBGRA.getCPtr(c), c);
  }

  public void serial(IStream f) {
    nelmiscJNI.CBGRA_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void blendFromui(CBGRA c0, CBGRA c1, long factor) {
    nelmiscJNI.CBGRA_blendFromui(swigCPtr, this, CBGRA.getCPtr(c0), c0, CBGRA.getCPtr(c1), c1, factor);
  }

  public void set(short r, short g, short b, short a) {
    nelmiscJNI.CBGRA_set(swigCPtr, this, r, g, b, a);
  }

  public void setB(short value) {
    nelmiscJNI.CBGRA_B_set(swigCPtr, this, value);
  }

  public short getB() {
    return nelmiscJNI.CBGRA_B_get(swigCPtr, this);
  }

  public void setG(short value) {
    nelmiscJNI.CBGRA_G_set(swigCPtr, this, value);
  }

  public short getG() {
    return nelmiscJNI.CBGRA_G_get(swigCPtr, this);
  }

  public void setR(short value) {
    nelmiscJNI.CBGRA_R_set(swigCPtr, this, value);
  }

  public short getR() {
    return nelmiscJNI.CBGRA_R_get(swigCPtr, this);
  }

  public void setA(short value) {
    nelmiscJNI.CBGRA_A_set(swigCPtr, this, value);
  }

  public short getA() {
    return nelmiscJNI.CBGRA_A_get(swigCPtr, this);
  }

}
